
                <div class="tableMain">
                    
                    <form method="post" action="index.php?admin=1&c=level&a=edit&id=<?php echo $_GET['id'];?>">
                
                    <label>权限名:</label><input name="name" type="text" value="<?php echo $arr['name'];?>" /><br/>
                        <ul style="margin-left:30px;width:500px;" class="levelinput">
                        权限:<br/>
                        <?php $xml = simplexml_load_file(MODEL_PATH.'list.xml');foreach($xml->module as $value):?>
                            <input type="checkbox" name="menu[]" <?php if(in_array($value->name->attributes()->id,$arr['menu'])){echo 'checked="checked"';}?> value="<?php echo $value->name->attributes()->id;?>" /><strong><?php echo $value->name;?></strong><br/>
                        <?php foreach ($value->method as $val):?>
                            <input type="checkbox" name="menu[]" <?php if(in_array($val->methodname->attributes()->id,$arr['menu'])){echo 'checked="checked"';}?> value="<?php echo $val->methodname->attributes()->id;?>"  /><?php echo $val->methodname;?>
                        <?php endforeach;?>
                        <br/>
                        <?php endforeach;?>
                        </ul>
                        <label>全选/取消<input type="checkbox" class="checkall" /></label>
                        <label>反选<input type="checkbox" class="rescheck" /></label>
                    <input type="submit" value="修改"/>
                    </form>   
                </div>
                <div id="page">
                <ul>
				
                </ul>
           		</div>
            <script>
                $('.checkall').click(function(){

                    var check=$(this).is(':checked');//判断是否选中

                    $('.levelinput').find('input').attr('checked',check);//赋给判断结果

                })

                $('.rescheck').click(function(){

                    $('.levelinput').find('input').each(function(){//判断是否选中，选中则变不选，不选变选中
                    var check=$(this).is(':checked');
                    $(this).attr('checked',!check);
                    })
                })
                
            </script>		   